package ru.pb.game.network.engine.auth.packets.receivable;

import ru.pb.game.network.GNetworkEngine;
import ru.pb.game.network.engine.auth.packets.AuthServerToGameServerPacket;

public class LOGIN_SERVER_FAIL extends AuthServerToGameServerPacket
{
	private static final String[] reasons =
	{
		"ХЗ",
		"Этот IP не разрешон",
		"Reason ip reserved",
		"Не подходит пароль",
		"Reason id reserved",
		"Reason no free ID",
		"Not authed",
		"Уже залогинен"
	};

	private int _reason;

	public String getReason()
	{
		return reasons[_reason];
	}

	@Override
	public void readImpl()
	{
		_reason = readC();
	}

	@Override
	public void runImpl()
	{
		_log.info("Неудачная регистрация: " + getReason());
		GNetworkEngine.getInstance().connect();
	}
}
